package com.wanxin.controller;

import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author common
 */
@RestControllerAdvice
public class ExpController {

    @ExceptionHandler(UnauthorizedException.class)
    public String handleShiroException(Exception ex){
        return "无权限";
    }
    @ExceptionHandler(AuthorizationException.class)
    public String authorizationException(Exception ex){
        return "权限认证失败";
    }

}
